package com.blockmeta.bbs.businesslibrary.widget;

import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;

/**
 * @author AirThor
 * @date 2019/10/15.
 */
public class DebateCommentTag extends RoundCornerTextView {
    private static final String POSITIVE = "正方";
    private static final int POSITIVE_COLOR = Color.parseColor("#FF0000");
    private static final String NEGATIVE = "反方";
    private static final int NEGATIVE_COLOR = Color.parseColor("#035BD4");
    private static final String NEUTRAL = "吃瓜";
    private static final int NEUTRAL_COLOR = Color.parseColor("#000000");

    public DebateCommentTag(Context context) {
        super(context);
    }

    public DebateCommentTag(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public DebateCommentTag(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public void setTag(int stand){
        if (stand==0){
            setStand(NEUTRAL,NEUTRAL_COLOR);
        }else if (stand == 1){
            setStand(POSITIVE,POSITIVE_COLOR);
        }else if (stand == 2){
            setStand(NEGATIVE,NEGATIVE_COLOR);
        }
    }

    private void setStand(String s,int c) {
        setText(s);
        setBackGroundColor(c);
    }
}
